* fileio.c: Use O_APPEND to append.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Jan 2013 18:58:40 +0000 (10:58 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Jan 2013 18:58:40 +0000 (10:58 -0800)
commitb5600c6c1ab58db465ae3b6f6e418d6a62260431
tree7db3fa8ea5831a74d44f912a5a8dc2e30f494e4a
parent2766c8458c3675fb100cd59e5a91e2d740fb7257
* fileio.c: Use O_APPEND to append.

This corresponds better to the natural interpretation of "append",
and avoids the need to open the output file twice, or to invoke
lseek when APPEND is neither nil nor a number.
This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
(Fwrite_region): Simplify.  Use O_APPEND instead of opening the
file possibly twice, and lseeking to its end; this avoids the
need to lseek on non-regular files.  Do not use O_EXCL and O_TRUNC
at the same time: the combination is never needed and apparently
it doesn't work with DOS_NT.
src/ChangeLog
src/fileio.c